<?
$parent=$_POST['parent'];
$search=$_POST['txtsearch'];
$loaitin=$_GET['loaitin'];
$links="index.php?progid=30&loai=".$loai;
//if($home!=""){$links="index.php?progid=6&home=1";}
	
$qid=$_GET[qid];
$sql=mysql_query("select *from question where qid=$qid");
$rowt=mysql_fetch_array($sql);
$id_tin=$rowt['qid'];
$tieude=$rowt['qtitle'];

?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td style="padding:10px">
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
  
  <tr>
    <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td   width="6" height="6"><img src="images/j_crn_tl_med.png" width="6" height="6" /></td>
            <td  background="images/j_crn_t_med.png" width="100%"></td>
            <td  width="6" height="6" ><img src="images/j_crn_tr_med.png" width="6" height="6" /></td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="1" background="images/dot.png"></td>
            <td class="bg_title"><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="5%"><img src="images/icon-48-menumgr.png" width="48" height="48" /></td>
                <td width="45%" class="mana_title">Danh sách câu trả lời  "<b style="color:#09F"> <?php echo $tieude; ?> </b> "</td>
                <td width="50%" align="center">
                  <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td width="65%">&nbsp;</td>
                      <td class="icon_style" ><a href="<?=$links?>&sanpham=tl_them&qid=<?=$qid?>"><img src="images/icon-32-new.png" width="32" height="32" border="0"/><br />
                      Th&ecirc;m</a></td>
                      
                     <td class="icon_style"><a href="#" onclick="return doSaveJobs('<?=$links?>&sanpham=tl_xoa&qid=<?=$qid?>','Vui lòng chọn một bản ghi từ danh sách bên dưới')" ><img src="images/icon-32-delete.png" width="32" height="32"  border="0"/><br />
                      X&oacute;a</a></td>
                      <td class="icon_style"><a href="#"><img src="images/icon-32-help.png" width="32" height="32"  border="0"/><br />
                      Tr&#7907; gi&uacute;p</a></td>
                    </tr>
                  </table>
                  </td>
              </tr>
            </table></td>
            <td width="1" background="images/dot.png"></td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="6" height="6" ><img src="images/j_crn_bl_med.png" width="6" height="6" /></td>
            <td  background="images/j_crn_b_med.png" width="100%"></td>
            <td width="6" height="6" ><img src="images/j_crn_br_med.png" width="6" height="6" /></td>
          </tr>
        </table></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td height="7"></td>
  </tr>
  <tr>
    <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td   width="6" height="6"><img src="images/j_crn_tl_med.png" width="6" height="6" /></td>
            <td  background="images/j_crn_t_med.png" width="100%"></td>
            <td  width="6" height="6" ><img src="images/j_crn_tr_med.png" width="6" height="6" /></td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td><table width="100%" border="0" cellspacing="0" cellpadding="0" >
          <tr>
            <td width="1" background="images/dot.png"></td>
            <td bgcolor="#fbfbfb"><form id="frmdanhsach" name="frmdanhsach" method="post" action="">
              <table width="100%" border="0" cellspacing="0" cellpadding="0">
                
                <tr>
                  <td style="padding:7px"><table width="100%" border="1" cellspacing="0" cellpadding="0" class="list_border">
                    <tr>
                      <td width="3%" class="list_title">#</td>
                      <td width="3%" class="list_title"> <input type="checkbox" name="chkAll" id="chkAll"  value="" onclick="CheckUncheckAll();" /></td>
                      <td width="21%" class="list_title">Tên câu trả lời</td>
                      <!--
                     	<td width="21%" class="list_title">Tạo câu trả lời</td>
                      -->
                      <td width="16%" class="list_title">Ngày tạo</td>
                      <td width="4%" class="list_title">ID</td>
                    </tr>
                    <? 					
	$sqlstring="select * from answer where qid=$qid";	
	
	$qr12=mysql_query($sqlstring);
	$n_record=mysql_num_rows($qr12); 
	if($n_record>0)
	{
	$p=$_SESSION['page'];
	$n=$_GET['n'];
	
	include 'phantrang.php';
	////////////////////////////////////////////////////
	$sqlstring.=" order by aid desc";
	if ($n!='all'){
	$sqlstring.=" limit $s,$p";
	
	 }
	$qr1=mysql_query($sqlstring); 
	$i=0;
	while($row=mysql_fetch_array($qr1)) 
	{ $i=$i+1;
  ?>
                    <tr  onmouseover="this.bgColor='#ffffdd'" onmouseout="this.bgColor=''" >
                      <td align="center" style="height:30"><a href="<?=$links?>&sanpham=add&id=<?=$row[aid]?>&loai=<?=$loai?>"><?=$i?></a></td>
                      <td align="center">
                      <input type="checkbox" name="industry<?=$i?>" id="industry<?=$i?>"  value="<?=$row[aid]?>"/></td>
                      <td class="link-edit"><a href="<?=$links?>&sanpham=tl_sua&aid=<?=$row[aid]?>&qid=<?php echo $id_tin;?>"><?=$row[atitle]?></a></td>
                      <td><?=$row[adate]?></td>
                      <td align="center"><?=$row[qid]?></td>
                    </tr>
<? }?>
                  </table></td>
                </tr>
                <tr>
                  <td><? view_page($links); ?></td>
                </tr>
              </table>
              <input type="hidden" name="count" id="count" value="<?=$i?>"  />
                        </form>
                        
  
            </td>
            <td width="1" background="images/dot.png"></td>
          </tr>
        </table></td>
      </tr>
         <?php } else echo "<b style='color:red'>chưa có câu trả lời nào </b> !";?>
      <tr>
        <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="6" height="6" ><img src="images/j_crn_bl_med.png" width="6" height="6" /></td>
            <td  background="images/j_crn_b_med.png" width="100%"></td>
            <td width="6" height="6" ><img src="images/j_crn_br_med.png" width="6" height="6" /></td>
          </tr>
        </table></td>
      </tr>
    </table></td>
  </tr>
</table>
</td>
  </tr>
</table>
